From fb7ef8f62cf607b9af2b121a76de0858201c65f3 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 14 Mar 2020 01:28:43 -0400 Subject: [PATCH] window: Drop sticky This is an X11-only concept that we don't have on Wayland. --- gtk/gtkwindow.c | 60 ------------------------------------------------- gtk/gtkwindow.h | 4 ---- 2 files changed, 64 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 696597e00b..1b0f2e7b9e 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -248,7 +248,6 @@ typedef struct guint focus_visible : 1; guint modal : 1; guint resizable : 1; - guint stick_initially : 1; guint transient_parent_group : 1; guint gravity : 5; /* GdkGravity */ guint csd_requested : 1; @@ -4790,7 +4789,6 @@ gtk_window_map (GtkWidget *widget) gtk_widget_get_child_visible (priv->title_box)) gtk_widget_map (priv->title_box); - gdk_toplevel_set_sticky (GDK_TOPLEVEL (priv->surface), priv->stick_initially); gdk_toplevel_set_keep_above (GDK_TOPLEVEL (priv->surface), priv->above_initially); gdk_toplevel_set_keep_below (GDK_TOPLEVEL (priv->surface), priv->below_initially); @@ -4863,7 +4861,6 @@ gtk_window_unmap (GtkWidget *widget) state = gdk_toplevel_get_state (GDK_TOPLEVEL (priv->surface)); priv->minimize_initially = (state & GDK_SURFACE_STATE_MINIMIZED) != 0; priv->maximize_initially = (state & GDK_SURFACE_STATE_MAXIMIZED) != 0; - priv->stick_initially = (state & GDK_SURFACE_STATE_STICKY) != 0; priv->above_initially = (state & GDK_SURFACE_STATE_ABOVE) != 0; priv->below_initially = (state & GDK_SURFACE_STATE_BELOW) != 0; @@ -7559,63 +7556,6 @@ gtk_window_unminimize (GtkWindow *window) gtk_window_update_toplevel (window); } -/** - * gtk_window_stick: - * @window: a #GtkWindow - * - * Asks to stick @window, which means that it will appear on all user - * desktops. Note that you shouldn’t assume the window is definitely - * stuck afterward, because other entities (e.g. the user or - * [window manager][gtk-X11-arch] could unstick it - * again, and some window managers do not support sticking - * windows. But normally the window will end up stuck. Just don't - * write code that crashes if not. - * - * It’s permitted to call this function before showing a window. - * - * You can track result of this operation via the #GdkSurface:state - * property. - */ -void -gtk_window_stick (GtkWindow *window) -{ - GtkWindowPrivate *priv = gtk_window_get_instance_private (window); - - g_return_if_fail (GTK_IS_WINDOW (window)); - - priv->stick_initially = TRUE; - - if (priv->surface) - gdk_toplevel_set_sticky (GDK_TOPLEVEL (priv->surface), TRUE); -} - -/** - * gtk_window_unstick: - * @window: a #GtkWindow - * - * Asks to unstick @window, which means that it will appear on only - * one of the user’s desktops. Note that you shouldn’t assume the - * window is definitely unstuck afterward, because other entities - * (e.g. the user or [window manager][gtk-X11-arch]) could - * stick it again. But normally the window will - * end up stuck. Just don’t write code that crashes if not. - * - * You can track result of this operation via the #GdkSurface:state - * property. - */ -void -gtk_window_unstick (GtkWindow *window) -{ - GtkWindowPrivate *priv = gtk_window_get_instance_private (window); - - g_return_if_fail (GTK_IS_WINDOW (window)); - - priv->stick_initially = FALSE; - - if (priv->surface) - gdk_toplevel_set_sticky (GDK_TOPLEVEL (priv->surface), FALSE); -} - /** * gtk_window_maximize: * @window: a #GtkWindow diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 7e08b9d78d..eb96e53e8a 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -235,10 +235,6 @@ void gtk_window_minimize (GtkWindow *window); GDK_AVAILABLE_IN_ALL void gtk_window_unminimize (GtkWindow *window); GDK_AVAILABLE_IN_ALL -void gtk_window_stick (GtkWindow *window); -GDK_AVAILABLE_IN_ALL -void gtk_window_unstick (GtkWindow *window); -GDK_AVAILABLE_IN_ALL void gtk_window_maximize (GtkWindow *window); GDK_AVAILABLE_IN_ALL void gtk_window_unmaximize (GtkWindow *window); -- 2.30.2